

#ifndef __ak_radio_h__
#define __ak_radio_h__

#include <linux/types.h>
#include <asm/ioctls.h>

#define AK_RADIO_READ _IO('m', 0x90)
#define AK_RADIO_READ_BAND _IOR('m', 0x91, unsigned char)
#define AK_RADIO_READ_NAMBER _IOR('m', 0x92, unsigned char)
#define AK_RADIO_READ_FREQENCY _IOR('m', 0x93, unsigned char)
#define AK_RADIO_READ_STRENGTH _IOR('m', 0x94, unsigned char)
#define AK_RADIO_READ_FLAG _IOR('m', 0x95, unsigned char)
#define AK_RADIO_READ_FREQS _IO('m', 0x96)
#define AK_RADIO_READ_REGION _IOR('m', 0x97, unsigned char)
#define AK_RADIO_READ_PARAM _IO('m', 0x98)

#define AK_RADIO_READ_RDS _IO('m', 0x99)
#define AK_RADIO_READ_RDS_FLAG _IOR('m', 0x9a, unsigned char)
#define AK_RADIO_READ_RDS_PTY _IO('m', 0x9b)
#define AK_RADIO_READ_RDS_PS _IO('m', 0x9c)
#define AK_RADIO_READ_RDS_RT _IO('m', 0x9d)
#define AK_RADIO_READ_RDS_PSLIST _IO('m', 0x9e)

#define AK_RADIO_READ_DEBUG_INFO _IO('m', 0xf0)
#define AK_RADIO_READ_RDS_DEBUG_INFO _IO('m', 0xf1)

#define AK_RADIO_WAIT_EVENT _IO('m', 0x9f)

#define AK_RADIO_WRITE_BAND _IOW('m', 0xa0, unsigned char)
#define AK_RADIO_AS _IO('m', 0xa1)
#define AK_RADIO_PS _IO('m', 0xa2)
#define AK_RADIO_SCAN _IO('m', 0xa3)
#define AK_RADIO_SEEK_UP _IO('m', 0xa4)
#define AK_RADIO_SEEK_DOWN _IO('m', 0xa5)
#define AK_RADIO_STEP_UP _IO('m', 0xa6)
#define AK_RADIO_STEP_DOWN _IO('m', 0xa7)
#define AK_RADIO_SCAN_STOP _IO('m', 0xa8)
#define AK_RADIO_WRITE_LOCDX _IOW('m', 0xa9, unsigned char)
#define AK_RADIO_PLAY _IOW('m', 0xaa, unsigned char)
#define AK_RADIO_SAVE _IOW('m', 0xab, unsigned char)
#define AK_RADIO_WRITE_REGION _IOW('m', 0xac, unsigned char)
#define AK_RADIO_WRITE_FREQENCY _IOW('m', 0xad, unsigned short)
#define AK_RADIO_WRITE_PARAM _IO('m', 0xae)
#define AK_RADIO_INFO _IO('m', 0xaf)

#define AK_RADIO_PRE_CHANNEL _IO('m', 0xd0)
#define AK_RADIO_NEXT_CHANNEL _IO('m', 0xd1)


#define AK_RADIO_RDS_AF_OFF _IO('m', 0xb0)
#define AK_RADIO_RDS_AF_ON _IO('m', 0xb1)
#define AK_RADIO_RDS_TA_OFF _IO('m', 0xb2)
#define AK_RADIO_RDS_TA_ON _IO('m', 0xb3)
#define AK_RADIO_RDS_EON_OFF _IO('m', 0xb4)
#define AK_RADIO_RDS_EON_ON _IO('m', 0xb5)
#define AK_RADIO_RDS_REG_OFF _IO('m', 0xb6)
#define AK_RADIO_RDS_REG_ON _IO('m', 0xb7)
#define AK_RADIO_RDS_PTY_OFF _IO('m', 0xb8)
#define AK_RADIO_RDS_PTY_ON _IO('m', 0xb9)
#define AK_RADIO_RDS_PTY_TYPE _IOW('m', 0xba, unsigned char)
#define AK_RADIO_RDS_PTY_SEEK_UP _IO('m', 0xbb)
#define AK_RADIO_RDS_PTY_SEEK_DOWN _IO('m', 0xbc)
#define AK_RADIO_RDS_INFO _IO('m', 0xbf)

#define AK_RADIO_READ_FREQ_RANGE _IO('m', 0x10)

#define AK_RADIO_INFO_BAND 0x00000001
#define AK_RADIO_INFO_NUMBER 0x00000002
#define AK_RADIO_INFO_FREQENCY 0x00000004
#define AK_RADIO_INFO_STRENGTH 0x00000008
#define AK_RADIO_INFO_FLAG 0x00000010
#define AK_RADIO_INFO_FREQS 0x00000020
#define AK_RADIO_INFO_REGION 0x00000040
#define AK_RADIO_INFO_PARAM 0x00000080
#define AK_RADIO_INFO_PS 0x00040000
#define AK_RADIO_INFO_LOCDX 0x00080000
#define AK_RADIO_INFO_STEREOMONO 0x00100000
#define AK_RADIO_INFO_SCAN 0x00200000
#define AK_RADIO_INFO_AS 0x00400000
#define AK_RADIO_INFO_SEEK 0x00800000
#define AK_RADIO_INFO_FREQ_RANGE 0x01000000

#define AK_RADIO_INFO_FLAG_PS 0x04
#define AK_RADIO_INFO_FLAG_LOCDX 0x08
#define AK_RADIO_INFO_FLAG_STEREOMONO 0x10
#define AK_RADIO_INFO_FLAG_SCAN 0x20
#define AK_RADIO_INFO_FLAG_AS 0x40
#define AK_RADIO_INFO_FLAG_SEEK 0x80

#define AK_RADIO_RDS_FLAG 0x00000200
#define AK_RADIO_RDS_PTY 0x00000400
#define AK_RADIO_RDS_PS 0x00000800
#define AK_RADIO_RDS_RT 0x00001000
#define AK_RADIO_RDS_PSLIST 0x00002000
#define AK_RADIO_RDS_DEBUG_INFO 0x00008000
#define AK_RADIO_RDS_TA 0x02000000
#define AK_RADIO_RDS_REG_SW 0x040000000
#define AK_RADIO_RDS_EON_SW 0x08000000
#define AK_RADIO_RDS_PTY_SW 0x10000000
#define AK_RADIO_RDS_TA_SW 0x20000000
#define AK_RADIO_RDS_AF_SW 0x40000000
#define AK_RADIO_RDS_TP 0x80000000

#define AK_RADIO_RDS_FLAG_TA 0x02
#define AK_RADIO_RDS_FLAG_REG_SW 0x04
#define AK_RADIO_RDS_FLAG_EON_SW 0x08
#define AK_RADIO_RDS_FLAG_PTY_SW 0x10
#define AK_RADIO_RDS_FLAG_TA_SW 0x20
#define AK_RADIO_RDS_FLAG_AF_SW 0x40
#define AK_RADIO_RDS_FLAG_TP 0x80

struct ak_radio_info{
	unsigned char band;
	unsigned char number;
	unsigned short freqency;
	unsigned char strength;
	unsigned char flag;
	unsigned short freqs[12];
	unsigned char region;
	unsigned char param[4];
};

struct ak_radio_rds{
	unsigned char flag;
	unsigned char pty[2];
	unsigned char ps[8];
	unsigned char rt[64];
	unsigned char pslist[12][8];	
	unsigned char dinfo[32];
};

struct ak_radio_freq_range{
	unsigned short max;
	unsigned short min;
};

#endif // __ak_radio_h__
